import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";

const { createConfirm } = useMessage();

enum Api {
  list = '/journey/bsTravelgroupTourorderrecord/list',
  save='/journey/bsTravelgroupTourorderrecord/add',
  edit='/journey/bsTravelgroupTourorderrecord/edit',
  deleteOne = '/journey/bsTravelgroupTourorderrecord/delete',
  deleteBatch = '/journey/bsTravelgroupTourorderrecord/deleteBatch',
  importExcel = '/journey/bsTravelgroupTourorderrecord/importExcel',
  exportXls = '/journey/bsTravelgroupTourorderrecord/exportXls',
  bsTravelgroupTouruserinforList = '/journey/bsTravelgroupTourorderrecord/listBsTravelgroupTouruserinforByMainId',
  bsTravelgroupTouruserinforSave='/journey/bsTravelgroupTourorderrecord/addBsTravelgroupTouruserinfor',
  bsTravelgroupTouruserinforEdit='/journey/bsTravelgroupTourorderrecord/editBsTravelgroupTouruserinfor',
  bsTravelgroupTouruserinforDelete = '/journey/bsTravelgroupTourorderrecord/deleteBsTravelgroupTouruserinfor',
  bsTravelgroupTouruserinforDeleteBatch = '/journey/bsTravelgroupTourorderrecord/deleteBatchBsTravelgroupTouruserinfor',
  bsTravelgroupTourcarpricerecordList = '/journey/bsTravelgroupTourorderrecord/listBsTravelgroupTourcarpricerecordByMainId',
  bsTravelgroupTourcarpricerecordSave='/journey/bsTravelgroupTourorderrecord/addBsTravelgroupTourcarpricerecord',
  bsTravelgroupTourcarpricerecordEdit='/journey/bsTravelgroupTourorderrecord/editBsTravelgroupTourcarpricerecord',
  bsTravelgroupTourcarpricerecordDelete = '/journey/bsTravelgroupTourorderrecord/deleteBsTravelgroupTourcarpricerecord',
  bsTravelgroupTourcarpricerecordDeleteBatch = '/journey/bsTravelgroupTourorderrecord/deleteBatchBsTravelgroupTourcarpricerecord',
  bsTravelgroupTourordershopproductrecordList = '/journey/bsTravelgroupTourorderrecord/listBsTravelgroupTourordershopproductrecordByMainId',
  bsTravelgroupTourordershopproductrecordSave='/journey/bsTravelgroupTourorderrecord/addBsTravelgroupTourordershopproductrecord',
  bsTravelgroupTourordershopproductrecordEdit='/journey/bsTravelgroupTourorderrecord/editBsTravelgroupTourordershopproductrecord',
  bsTravelgroupTourordershopproductrecordDelete = '/journey/bsTravelgroupTourorderrecord/deleteBsTravelgroupTourordershopproductrecord',
  bsTravelgroupTourordershopproductrecordDeleteBatch = '/journey/bsTravelgroupTourorderrecord/deleteBatchBsTravelgroupTourordershopproductrecord',
  bsTravelgroupTourorderhotelroomrecordList = '/journey/bsTravelgroupTourorderrecord/listBsTravelgroupTourorderhotelroomrecordByMainId',
  bsTravelgroupTourorderhotelroomrecordSave='/journey/bsTravelgroupTourorderrecord/addBsTravelgroupTourorderhotelroomrecord',
  bsTravelgroupTourorderhotelroomrecordEdit='/journey/bsTravelgroupTourorderrecord/editBsTravelgroupTourorderhotelroomrecord',
  bsTravelgroupTourorderhotelroomrecordDelete = '/journey/bsTravelgroupTourorderrecord/deleteBsTravelgroupTourorderhotelroomrecord',
  bsTravelgroupTourorderhotelroomrecordDeleteBatch = '/journey/bsTravelgroupTourorderrecord/deleteBatchBsTravelgroupTourorderhotelroomrecord',
}
/**
 * 导出api
 * @param params
 */
export const getExportUrl = Api.exportXls;

/**
 * 导入api
 */
export const getImportUrl = Api.importExcel;
/**
 * 列表接口
 * @param params
 */
export const list = (params) =>
  defHttp.get({url: Api.list, params});

/**
 * 删除单个
 */
export const deleteOne = (params,handleSuccess) => {
  return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
    handleSuccess();
  });
}
/**
 * 批量删除
 * @param params
 */
export const batchDelete = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
        handleSuccess();
      });
    }
  });
}
/**
 * 保存或者更新
 * @param params
 */
export const saveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.edit : Api.save;
  return defHttp.post({url: url, params});
}
/**
 * 列表接口
 * @param params
 */
export const bsTravelgroupTouruserinforList = (params) => {
  if(params['tourorderrecordid']){
    return defHttp.get({url: Api.bsTravelgroupTouruserinforList, params});
  }
  return Promise.resolve({});
}


/**
 * 删除单个
 */
export const bsTravelgroupTouruserinforDelete = (params,handleSuccess) => {
  return defHttp.delete({url: Api.bsTravelgroupTouruserinforDelete, params}, {joinParamsToUrl: true}).then(() => {
    handleSuccess();
  });
}
/**
 * 批量删除
 * @param params
 */
export const bsTravelgroupTouruserinforDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({url: Api.bsTravelgroupTouruserinforDeleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
        handleSuccess();
      });
    }
  });
}
/**
 * 保存或者更新
 * @param params
 */
export const  bsTravelgroupTouruserinforSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.bsTravelgroupTouruserinforEdit : Api.bsTravelgroupTouruserinforSave;
  return defHttp.post({url: url, params});
}
/**
 * 导入
 */
export const bsTravelgroupTouruserinforImportUrl = '/journey/bsTravelgroupTourorderrecord/importBsTravelgroupTouruserinfor'

/**
 * 导出
 */
export const bsTravelgroupTouruserinforExportXlsUrl = '/journey/bsTravelgroupTourorderrecord/exportBsTravelgroupTouruserinfor'
/**
 * 列表接口
 * @param params
 */
export const bsTravelgroupTourcarpricerecordList = (params) => {
  if(params['tourorderrecordid']){
    return defHttp.get({url: Api.bsTravelgroupTourcarpricerecordList, params});
  }
  return Promise.resolve({});
}


/**
 * 删除单个
 */
export const bsTravelgroupTourcarpricerecordDelete = (params,handleSuccess) => {
  return defHttp.delete({url: Api.bsTravelgroupTourcarpricerecordDelete, params}, {joinParamsToUrl: true}).then(() => {
    handleSuccess();
  });
}
/**
 * 批量删除
 * @param params
 */
export const bsTravelgroupTourcarpricerecordDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({url: Api.bsTravelgroupTourcarpricerecordDeleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
        handleSuccess();
      });
    }
  });
}
/**
 * 保存或者更新
 * @param params
 */
export const  bsTravelgroupTourcarpricerecordSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.bsTravelgroupTourcarpricerecordEdit : Api.bsTravelgroupTourcarpricerecordSave;
  return defHttp.post({url: url, params});
}
/**
 * 导入
 */
export const bsTravelgroupTourcarpricerecordImportUrl = '/journey/bsTravelgroupTourorderrecord/importBsTravelgroupTourcarpricerecord'

/**
 * 导出
 */
export const bsTravelgroupTourcarpricerecordExportXlsUrl = '/journey/bsTravelgroupTourorderrecord/exportBsTravelgroupTourcarpricerecord'
/**
 * 列表接口
 * @param params
 */
export const bsTravelgroupTourordershopproductrecordList = (params) => {
  if(params['tourorderrecordid']){
    return defHttp.get({url: Api.bsTravelgroupTourordershopproductrecordList, params});
  }
  return Promise.resolve({});
}


/**
 * 删除单个
 */
export const bsTravelgroupTourordershopproductrecordDelete = (params,handleSuccess) => {
  return defHttp.delete({url: Api.bsTravelgroupTourordershopproductrecordDelete, params}, {joinParamsToUrl: true}).then(() => {
    handleSuccess();
  });
}
/**
 * 批量删除
 * @param params
 */
export const bsTravelgroupTourordershopproductrecordDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({url: Api.bsTravelgroupTourordershopproductrecordDeleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
        handleSuccess();
      });
    }
  });
}
/**
 * 保存或者更新
 * @param params
 */
export const  bsTravelgroupTourordershopproductrecordSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.bsTravelgroupTourordershopproductrecordEdit : Api.bsTravelgroupTourordershopproductrecordSave;
  return defHttp.post({url: url, params});
}
/**
 * 导入
 */
export const bsTravelgroupTourordershopproductrecordImportUrl = '/journey/bsTravelgroupTourorderrecord/importBsTravelgroupTourordershopproductrecord'

/**
 * 导出
 */
export const bsTravelgroupTourordershopproductrecordExportXlsUrl = '/journey/bsTravelgroupTourorderrecord/exportBsTravelgroupTourordershopproductrecord'
/**
 * 列表接口
 * @param params
 */
export const bsTravelgroupTourorderhotelroomrecordList = (params) => {
  if(params['tourorderrecordid']){
    return defHttp.get({url: Api.bsTravelgroupTourorderhotelroomrecordList, params});
  }
  return Promise.resolve({});
}


/**
 * 删除单个
 */
export const bsTravelgroupTourorderhotelroomrecordDelete = (params,handleSuccess) => {
  return defHttp.delete({url: Api.bsTravelgroupTourorderhotelroomrecordDelete, params}, {joinParamsToUrl: true}).then(() => {
    handleSuccess();
  });
}
/**
 * 批量删除
 * @param params
 */
export const bsTravelgroupTourorderhotelroomrecordDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({url: Api.bsTravelgroupTourorderhotelroomrecordDeleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
        handleSuccess();
      });
    }
  });
}
/**
 * 保存或者更新
 * @param params
 */
export const  bsTravelgroupTourorderhotelroomrecordSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.bsTravelgroupTourorderhotelroomrecordEdit : Api.bsTravelgroupTourorderhotelroomrecordSave;
  return defHttp.post({url: url, params});
}
/**
 * 导入
 */
export const bsTravelgroupTourorderhotelroomrecordImportUrl = '/journey/bsTravelgroupTourorderrecord/importBsTravelgroupTourorderhotelroomrecord'

/**
 * 导出
 */
export const bsTravelgroupTourorderhotelroomrecordExportXlsUrl = '/journey/bsTravelgroupTourorderrecord/exportBsTravelgroupTourorderhotelroomrecord'
